<?php namespace Summer\Userhub\Updates;

use Schema;
use Winter\Storm\Database\Updates\Migration;

class UserAddProjectFields extends Migration
{
    public function up()
    {
        if (Schema::hasColumns('users', [
            //微信所需
            'openid',
        ])) {
            return;
        }

        Schema::table('users', function($table)
        {
            $table->string('openid')->nullable();//微信所需
        });
    }

    public function down()
    {
        if (Schema::hasTable('users')) {
            Schema::table('users', function ($table) {
                $table->dropColumn([
                    'openid',
                ]);
            });
        }
    }
}
